﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for clsTaoDeThi
/// </summary>
public class clsTaoDeThi
{
    QLDETHIDataContext obj_taodt = new QLDETHIDataContext();
	public clsTaoDeThi()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    
    public void TaoDeThi(string madt,string maqt)
    {


        int kho = (from p in obj_taodt.QUYTACDEs
                  where p.MaQT == maqt
                  select p.Kho).Single();
        obj_taodt.sp_LayRDCH(kho, madt, "Kho");
        
        int tb = (from p in obj_taodt.QUYTACDEs
                   where p.MaQT == maqt
                  select p.TB).Single();
        obj_taodt.sp_LayRDCH(tb, madt, "TB");
        
        int de = (from p in obj_taodt.QUYTACDEs
                   where p.MaQT == maqt
                  select p.De).Single();
        obj_taodt.sp_LayRDCH(de, madt, "De");

        obj_taodt.SubmitChanges();
    }
}
